import { makeAutoObservable } from 'mobx';
import i18n from '../../i18n';

// 获取全局t函数
const t = i18n.t;

const items = [
  {
    id: 1,
    name: t('home.Big-or-Smaill'),
    src2: './gameDetail/games/a1s.png',
    src: './gameDetail/games/a1.png',
    logo: './gameDetail/a1logo.png',
  },
  {
    id: 2,
    name: t('home.Hash-Odd-Even'),
    src2: './gameDetail/games/a2s.png',
    src: './gameDetail/games/a2.png',
    logo: './gameDetail/a2logo.png',
  },
  {
    id: 3,
    name: t('home.Lucky-Hash'),
    src2: './gameDetail/games/a3s.png',
    src: './gameDetail/games/a3.png',
    logo: './gameDetail/a3logo.png',
  },
  {
    id: 4,
    name: t('home.Hash-Number'),
    src2: './gameDetail/games/a4s.png',
    src: './gameDetail/games/a4.png',
    logo: './gameDetail/a4logo.png',
  },
];

class GameDetailStore {
  // 选中的菜单项ID
  selectedItemId: undefined | number = undefined;
  items = items;
  constructor() {
    makeAutoObservable(this);
  }

  // 设置选中的菜单项
  setSelectedItemId(id: number) {
    this.selectedItemId = id;
  }
}

export default new GameDetailStore();
